Skip to content

Conversation

@sberyozkin
Copy link
Member

Fixes #51133.

I did a mistake 4 years ago in 4a42b44 where the audience property had its trailing slash, if present, removed in OidcCommonUtils#signJwtWithKey, because this is what was necessary to get the Keycloak test passing (Keycloak realm endpoint URL is used as an audience by default), but it is really in application.properties where the users should deal with having the trailing slash present or not.

There is also quarkus.credentials.jwt.audience property that can always be used to customize it.

@sberyozkin sberyozkin changed the title Do not update JWT authentication token audience Do not change configured JWT authentication token audience value Nov 20, 2025
@quarkus-bot

This comment has been minimized.

Copy link
Member

@michalvavrik michalvavrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to add a property to control the buggy OIDC behavior to an already massive set of existing OIDC props :-)

Personally, I'd call it undocumented behavior. I understand that #51133 has API that accepts aud with the ending slash. And we should give them way to end it with slash other than to add two slashes. I tried to look it up and it seems to be common to have the URI without ending slash.

@quarkus-bot

This comment has been minimized.

@sberyozkin
Copy link
Member Author

Hi Michal, @michalvavrik

And we should give them way to end it with slash other than to add two slashes.

Right, but users who do not need a slash already have an option not to add it, instead of adding it and expecting it be removed... When it comes to configuring an audience, the configured value, whatever it is, is a user provided value - users have already expressed a requirement with something like http://my.audience/ so asking them to add one more property to retain trailing / seems excessive...

I'm not aware of any OIDC spec text that would require that the JWT audience claim value must not end with /.

Sigh... having said all of that, I think with a property this PR can become bacportable...

Let me think about this property

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Nov 22, 2025

🙈 The PR is closed and the preview is expired.

Copy link
Member

@michalvavrik michalvavrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

@sberyozkin
Copy link
Member Author

Thanks @michalvavrik, @gastaldi, so I added a property to allow keeping the trailing slash (default is false as on main) to avoid any release breaking side-effects

@quarkus-bot

This comment has been minimized.

@quarkus-bot

This comment has been minimized.

@sberyozkin sberyozkin changed the title Do not change configured JWT authentication token audience value Allow to keep JWT audience trailing slash Nov 23, 2025
@quarkus-bot
Copy link

quarkus-bot bot commented Nov 23, 2025

Status for workflow Quarkus Documentation CI

This is the status report for running Quarkus Documentation CI on commit e04e32b.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

Warning

There are other workflow runs running, you probably need to wait for their status before merging.

@quarkus-bot
Copy link

quarkus-bot bot commented Nov 23, 2025

Status for workflow Quarkus CI

This is the status report for running Quarkus CI on commit e04e32b.

✅ The latest workflow run for the pull request has completed successfully.

It should be safe to merge provided you have a look at the other checks in the summary.

You can consult the Develocity build scans.

@sberyozkin sberyozkin merged commit 06368d0 into quarkusio:main Nov 23, 2025
33 checks passed
@quarkus-bot quarkus-bot bot added this to the 3.31 - main milestone Nov 23, 2025
@sberyozkin sberyozkin deleted the jwt_aud_trailing_slash branch November 23, 2025 19:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audience is modified in jwt when using quarkus.oidc-client.credentials.jwt.audience

3 participants